import java.util.Scanner;
//寄快递
public class Test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
            float a =in.nextFloat();
            char  b = in.next().charAt(0);
            int x = 0;
            if(a < 1) {
                System.out.println(20);
            }else {
                if(b == 'y') {
                  x = 20 + (int)Math.ceil(a - 1.0) + 5;
                }
                else if(b == 'n'){
                    x = 20 + (int)Math.ceil(a - 1.0);
                }
                System.out.println(x);
            }
        }
}
